import { PathTypeEnum } from "../../constant/PathTypeEnum.mjs";

/**
 * 目录含义
 */
export default class MeaningOfPath {
  /**
   * 类型
   * @type PathTypeEnum
   */
  type

  /**
   * 主键
   * @type {number | string | null | undefined}
   */
  id

  /**
   * 名称
   * @type {string | null | undefined}
   */
  name

  /**
   * 详细信息
   * @type {LocalAuthor | LocalTag | Works | WorksSet | Site | null | undefined}
   */
  details

  /**
   * @param meaningOfPath : MeaningOfPath
   */
  constructor(meaningOfPath) {
    if (meaningOfPath === undefined) {
      this.type = PathTypeEnum.UNKNOWN
      this.id = undefined
      this.name = undefined
      this.details = undefined
    } else {
      this.type = meaningOfPath.type
      this.id = meaningOfPath.id
      this.name = meaningOfPath.name
      this.details = meaningOfPath.details
    }
  }
}
